//
//  BiCustomerInfoViewController.m
//  TrunkIndustryManageSystem
//
//  Created by WT_lyy on 15/4/22.
//  Copyright (c) 2015年 李璐西. All rights reserved.
//
#define BOTTOM_BUTTON_HEIGHT 40
#import "BiCustomerInfoViewController.h"

@interface BiCustomerInfoViewController ()<UITableViewDataSource,UITableViewDelegate>{

    UITableView * _tableView;
}

@end

@implementation BiCustomerInfoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    [self setNavBarTitle:@"客户信息"];
    
    [self setNavBarWithHidden:NO];
    
    [self setNavBackBtn];
    
    _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, [self viewTop], MAIN_SCREEN_WIDTH, MAIN_SCREEN_HEIGHT-[self viewTop]-BOTTOM_BUTTON_HEIGHT)];
    
    _tableView.delegate = self;
    
    _tableView.dataSource = self;
    
    [self.view addSubview:_tableView];
    
    _tableView.rowHeight = 126;
    
    _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    
    UIButton * btnSaeve = GET_BUTTON(CGRectMake(0, MAIN_SCREEN_HEIGHT-BOTTOM_BUTTON_HEIGHT, MAIN_SCREEN_WIDTH, BOTTOM_BUTTON_HEIGHT), 17, NO, UIColorFromRGB(BLUE_COLOR_VALUE));
    
    [self.view addSubview:btnSaeve];
    
    btnSaeve.backgroundColor = [UIColor blueColor];
    
    [btnSaeve setTitle:@"保存" forState:UIControlStateNormal];
    
    [btnSaeve addTarget:self action:@selector(btnSaveClick:) forControlEvents:UIControlEventTouchUpInside];
}


#pragma -mark  Button Action
- (void)btnSaveClick:(UIButton *)sender{
    
    
}

#pragma -mark UitabeViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    [tableView deselectRowAtIndexPath:indexPath animated:NO];
}

#pragma -mark UitabeViewDatasource

- (NSInteger )tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 3;
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString * myIndentifier = @"CustomerCell";
    
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:myIndentifier];
    
    if (!cell)
    {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:myIndentifier];
        
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        
        UILabel * labtitle = GET_LABEL(CGRectMake(0, 0, MAIN_SCREEN_WIDTH, 34), 14, NO, [UIColor blueColor], NSTextAlignmentLeft);
        
        labtitle.backgroundColor = UIColorFromRGB(0xf6f7f9);
        
        [cell addSubview:labtitle];
        
        labtitle.tag = 1;
        
        UIImageView * imView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 40, MAIN_SCREEN_WIDTH, 80)];
        
        [cell addSubview:imView];
        
        imView.image = [UIImage imageNamed:@""];
        
        imView.tag = 2;
        
        UIButton * btnUpimage = GET_BUTTON(CGRectMake(240, 80, 70, 40), 14, NO, [UIColor whiteColor]);
        
        [btnUpimage setTitle:@"照片上传" forState:UIControlStateNormal];
        
        btnUpimage.backgroundColor = UIColorFromRGB(ORANGE_COLOR_VALUE);
        
        btnUpimage.tag = indexPath.row;
    }
    
    UILabel * labtitl = (UILabel *)[cell viewWithTag:1];
    
    if (0 == indexPath.row) {
        
        labtitl.text = @"客户合影:";
    }else if (1 == indexPath.row){
        
        labtitl.text = @"客户与车的合影:";
    }else if (2 == indexPath.row){
        
        labtitl.text = @"就餐合影:";
    }
    
    return cell;
}

#pragma -mark Net Delegate
- (void)onNetEngineResponse:(int)tag entity:(id)entity userInfo:(NSDictionary *)userInfo
{
    
    [self removeHUDView:self];
    
    
    
}
- (void)onNetEngineResponseFail:(int)tag entity:(id)entity userInfo:(NSDictionary *)userInfo
{
    [self removeHUDView:self];
    
}



@end
